var lengthOfLongestSubstring = function (s) {
	const map = new Map()
	const len = s.length
	const arr = []

	let left = 0
	let right = 1

	for (let i = 0; i < len; i++) {
		const str = s.slice(left, right)
		const next = s[i + 1]
		if (str.includes(next)) {
			arr.push(str.length - 1)
			left++
		}
		right++
		console.log(str)
	}
	console.log(Math.max(...arr), '======')
}

console.log(lengthOfLongestSubstring('abcabcbb'))
